<!DOCTYPE HTML>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../css/reset.css"/>
    <link rel="stylesheet" href="../css/toup.css"/>
    <script src="../js/jquery-1.11.3.js"></script>
    <script src="../js/fontSize.js"></script>
    <title>实体店新零售调查问卷</title>
</head>
<body>
<section class="toup" id="t1">
    <div class="swipers">
        <div class="con">
            <h1>实体店新零售调查问卷</h1>
            <p>
                知鱼科技是福州知名企业，2017年和微软公司全球发布了第一套智慧新零售解决方案，帮助线下实体店通过AI（人工智能）的方式分析顾客，实现有温度的营销，为顾客提供更好的服务。2018年台江区政府协同知鱼科技等十几家企业发起成立“新零售产业联盟”，知鱼科技将通过这份问卷调查您的需求，更好的为福州广大实体店主服务。</p>
        </div>
        <a href="javascript:;" class="jion">参加本调查</a>
    </div>
</section>
<div class="toup" id="t2">
    <div class="swipers">
        <!-- 上下 -->
        <div class="swiper-container">
            <div class="swiper-wrapper">
                <div class="swiper-slide">
                    <div class="scores">
                        <h3>1、帮助您轻松建立公众号，并且协助吸引粉丝成为熟客是否有需求？</h3>
                        <div class="choose">
                            <div class="input"><input type="radio" name="score" id="1" value="无所谓"/><label
                                    for="1">无所谓</label></div>
                            <div class="input"><input type="radio" name="score" id="2" value="一般"/><label
                                    for="2">一般 </label></div>
                            <div class="input"><input type="radio" name="score" id="3" value="很有需求"/><label
                                    for="3">很有需求 </label></div>
                        </div>
                    </div>
                </div>
                <div class="swiper-slide">
                    <div class="scores">
                        <h3>2、吸引顾客使用本店优惠券多次消费对你是否有吸引力？</h3>
                        <div class="choose">
                            <div class="input"><input type="radio" name="score1" id="6" value="无所谓"/><label
                                    for="6">无所谓</label></div>
                            <div class="input"><input type="radio" name="score1" id="7" value="一般"/><label
                                    for="7">一般</label></div>
                            <div class="input"><input type="radio" name="score1" id="8" value="很有吸引力"/><label for="8">很有吸引力</label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="swiper-slide">
                    <div class="scores">
                        <h3>3、一台AI（人工智能）触摸屏设备，您希望具备什么功能（可多选）？</h3>
                        <div class="choose">
                            <div class="input"><input type="checkbox" name="score2" id="11"
                                                      value="无所谓"/><label for="11">无所谓</label></div>
                            <div class="input"><input type="checkbox" name="score2" id="12"
                                                      value="吸引顾客加本店的公众号"/><label for="12">吸引顾客加本店的公众号</label></div>
                            <div class="input"><input type="checkbox" name="score2" id="13"
                                                      value="吸引顾客扫本店的优惠券"/><label for="13">吸引顾客扫本店的优惠券</label></div>
                            <div class="input"><input type="checkbox" name="score2" id="14"
                                                      value="帮助店主分析顾客的消费习惯"/><label for="14">帮助店主分析顾客的消费习惯</label>
                            </div>
                            <div class="input"><input type="checkbox" name="score2" id="15" value="常客进店时提醒店主"/><label
                                    for="15">常客进店时提醒店主</label></div>
                        </div>
                    </div>
                </div>
                <div class="swiper-slide">
                    <div class="scores">
                        <h3>4、使用具备以上功能的AI（人工智能）设备，您希望每月价格是多少？</h3>
                        <div class="choose">
                            <div class="input"><input type="radio" name="score3" id="16" value="不需要"/><label for="16">不需要</label>
                            </div>
                            <div class="input"><input type="radio" name="score3" id="17" value="每月50元"/><label for="17">每月50元</label>
                            </div>
                            <div class="input"><input type="radio" name="score3" id="18" value="每月100元"/><label
                                    for="18">每月100元</label></div>
                            <div class="input"><input type="radio" name="score3" id="19" value="免费，可以付设备押金"/><label
                                    for="19">免费，可以付设备押金</label></div>
                        </div>
                    </div>
                </div>
                <div class="swiper-slide">
                    <div class="scores">
                        <h3>5、具备以上功能的AI（人工智能）触摸屏设备如果免费给您试用3年，而且每月还给您试用费，您是否想报名尝试？</h3>
                        <div class="choose">
                            <div class="input"><input type="radio" name="score4" id="21" value="无所谓"/><label for="21">无所谓</label>
                            </div>
                            <div class="input"><input type="radio" name="score4" id="22" value="不想"/><label
                                    for="22">不想</label></div>
                            <div class="input"><input type="radio" name="score4" id="23" value="很想"/><label
                                    for="23">很想</label></div>
                        </div>
                    </div>
                </div>
                <div class="swiper-slide">
                    <div class="scores">
                        <h3>6、免费试用的AI触摸屏设备是否介意平常播放无声音的广告？</h3>
                        <div class="choose">
                            <div class="input"><input type="radio" name="score5" id="26" value="无所谓"/><label for="26">无所谓</label>
                            </div>
                            <div class="input"><input type="radio" name="score5" id="27" value="介意"/><label
                                    for="27">介意</label></div>
                            <div class="input"><input type="radio" name="score5" id="28" value="不介意"/><label for="28">不介意</label>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
<section class="toup" id="t3">
    <div class="swipers">
        <div class="con con1">
            <div class="smile">
                <p>您的回答将有助于免费试用以上提到的AI（人工智能）触摸屏设备</p>
                <p>请仔细填写您的相关信息，谢谢</p>
            </div>
            <input type="text" name="company" id="company" class="texts" maxlength="50" placeholder="店名"/>
            <input type="text" name="address" id="address" class="texts" maxlength="200" placeholder="地址"/>
            <input type="text" name="name" id="name" class="texts" maxlength="6" placeholder="姓名"/>
            <input type="text" name="phone" id="phone" class="texts" maxlength="11" placeholder="手机"/>
            <input type="text" name="clerk" id="clerk" class="texts" maxlength="6" placeholder="业务员(必填)"/>
        </div>
        <a href="javascript:;" class="tijiao" onclick="tijiao();">提交调查</a>
    </div>
</section>
<script>
    var i = 0;
    var answeList;
    $("#t2,#t3").hide();
    $("a.jion").on("click", function () {
        $("#t1").hide();
        $("#t2").show()
        $("#t3").show()
    });

    /**
     * 提交
     */
    function tijiao() {
        var val = $('input[name="score"]:checked').val();
        var val1 = $('input[name="score1"]:checked').val();
        var val2 = $("input:checkbox[name='score2']:checked").map(function (index, elem) {
            return $(elem).val();
        }).get().join(',');
        var val3 = $('input[name="score3"]:checked').val();
        var val4 = $('input[name="score4"]:checked').val();
        var val5 = $('input[name="score5"]:checked').val();
        if (isEmpty(val)) {
            return alert("第1题未填写");
        } else if (isEmpty(val1)) {
            return alert("第2题未填写");
        } else if (isEmpty(val2)) {
            return alert("第3题未填写");
        } else if (isEmpty(val3)) {
            return alert("第4题未填写");
        } else if (isEmpty(val4)) {
            return alert("第5题未填写");
        } else if (isEmpty(val5)) {
            return alert("第6题未填写");
        } else {
            answeList = new Array();
            var obj = {};
            obj['value'] = val;
            obj['type'] = 1;
            obj['number'] = 1;
            var obj1 = {};
            obj1['value'] = val1;
            obj1['type'] = 1;
            obj1['number'] = 2;
            var obj2 = {};
            obj2['value'] = val2;
            obj2['type'] = 2;
            obj2['number'] = 3;
            var obj3 = {};
            obj3['value'] = val3;
            obj3['type'] = 1;
            obj3['number'] = 4;
            var obj4 = {};
            obj4['value'] = val4;
            obj4['type'] = 1;
            obj4['number'] = 5;
            var obj5 = {};
            obj5['value'] = val5;
            obj5['type'] = 1;
            obj5['number'] = 6;
            answeList.push(obj);
            answeList.push(obj1);
            answeList.push(obj2);
            answeList.push(obj3);
            answeList.push(obj4);
            answeList.push(obj5);
        }
        var company = $("#company").val();
        var address = $("#address").val();
        var name = $("#name").val();
        var phone = $("#phone").val();
        if (isNaN(phone)) {
            return alert("手机号只能为数字");
        }
        var clerk = $("#clerk").val();
        if (isEmpty(clerk)) {
            return alert("请填写业务员");
        }
        var objectData = {
            "name": name,
            "company": company,
            "address": address,
            "phone": phone,
            "clerk": clerk,
            "answeList": answeList,
        };
        objectData = JSON.stringify(objectData);
        $.ajax({
            type: "POST",
            url: "/index/insert",
            contentType: 'application/json',
            data: objectData,
            datatype: "json",
            success: function (data) {
                if (data.code == 1) {
                    alert(data.msg);
                    window.location.reload();
                } else {
                    alert(data.msg);
                }
            },
            //调用出错执行的函数
            error: function () {
                //请求出错处理
                alert("系统异常");
                window.location.reload();
            }
        });
    }


    /**
     * 判断非空
     * @param str
     * @returns {boolean}
     */
    function isEmpty(str) {
        if (str === null || str === '' || str === undefined) {
            return true;
        }
        return false;
    }

</script>
</body>
</html>